
public class HoleCountFeature implements Feature {

	@Override
	public double computeScore(Stateview s) {
		int[] top = s.getTop();
		int[][] field = s.getField();
		
		int holeSize = 0;
		
		// compute the size of holes
		for(int col=0; col<Stateview.COLS; col++) {
			for(int row=0; row<top[col]; row++) {
				if(field[row][col] == 0)
					holeSize++;
			}
		}
			
		return -holeSize*30;
	}

}
